package com.jrtc.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jrtc.base.entity.bo.PatientAppointment;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;

/**
 * 患者预约单表(PatientAppointment)表数据库访问层
 *
 * @author makejava
 * @since 2022-03-21 17:30:14
 */
public interface PatientAppointmentDao {

    /**
     * 通过ID查询单条数据
     *
     * @param appointmentId 主键
     * @return 实例对象
     */
    PatientAppointment queryById(Integer appointmentId);

    /**
     * 查询指定行数据
     *
     * @param offset 查询起始位置
     * @param limit 查询条数
     * @return 对象列表
     */
    List<PatientAppointment> queryAllByLimit(@Param("offset") int offset, @Param("limit") int limit);

    IPage<PatientAppointment> queryPatientAppointmentList(Page<PatientAppointment> page, @Param("patientAppointment") PatientAppointment patientAppointment);

    /**
     * 通过实体作为筛选条件查询
     *
     * @param patientAppointment 实例对象
     * @return 对象列表
     */
    List<PatientAppointment> queryAll(PatientAppointment patientAppointment);

    /**
     * 新增数据
     *
     * @param patientAppointment 实例对象
     * @return 影响行数
     */
    int insert(PatientAppointment patientAppointment);

    /**
     * 修改数据
     *
     * @param patientAppointment 实例对象
     * @return 影响行数
     */
    int update(PatientAppointment patientAppointment);

    /**
     * 通过主键删除数据
     *
     * @param appointmentId 主键
     * @return 影响行数
     */
    int deleteById(Integer appointmentId);

    /**
     * 患者预约列表
     * */
    public List<PatientAppointment> selectPatientAppointmentList(@Param("appointmentTime") String appointmentTime, @Param("patientId") Integer patientId);

    /**
     * 患者创建新预约
     * */
    public int insertPatientAppointment(PatientAppointment patientAppointment);

    /**
     * 获取指定日期的所有预约单信息
     * */
    public List<PatientAppointment> selectPatientAppointmentByAppointmentTime(String appointmentTime);

    /**
     * 患者未完成预约列表
     * */
    public List<PatientAppointment> selectPatientAppointmentByPatientId(Integer id);

    /**
     * 患者最近完成预约
     * */
    public PatientAppointment selectPatientAppointmentById(Integer id);
}